package com.huawei.iocc.goods.controller;

import com.huawei.base.BaseRes;
import com.huawei.iocc.goods.entity.GoodsEntity;
import com.huawei.iocc.goods.service.GoodsService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author 黄后林
 * @date 2022-11-03 15:07:54
 * @note 程序员是用代码喂出来的
 */

@RestController
@RequestMapping("goods")
public class GoodsController {

    @Resource
    private GoodsService service;


    // http://localhost:8083/goods/all
    @GetMapping("all")
    public BaseRes getAll(){
        List<GoodsEntity> list = service.getAll();
        return BaseRes.getSuccess(list);
    }
}
